<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui/css/H-ui.min.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/H-ui.admin.css"/>
    <link rel="stylesheet" type="text/css" href="../../../lib/Hui-iconfont/1.0.8/iconfont.css"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/skin/default/skin.css" id="skin"/>
    <link rel="stylesheet" type="text/css" href="../../../static/h-ui.admin/css/style.css"/>
    <link rel="stylesheet" href="../../../lib/pagination/pagination.css">
    <link rel="stylesheet" type="text/css" href="../../../ht-css/Project.css"/>
    <link rel="stylesheet" type="text/css" href="../../../ht-css/style-q.css"/>
    <title></title>
</head>
<style>
</style>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页  <span class="c-gray en">&gt;</span>品牌官网配置 <span class="c-gray en">&gt;</span> 客户留言管理<span class="c-gray en">&gt;</span> 详情<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<article class="page-container">
    <form class="ml-20 mr-20 " id="form-memberadd">
        <div class="bk-gray bg-1 pt-20">
            <table class="table table_li">
                <tbody>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>姓名：</span></label>
                            <input   type="text" class="input-text f-l w-250" id="personName"
                                     placeholder="请输入姓名"  autocomplete="off" disabled>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>电话：</span></label>
                            <input   type="text" class="input-text f-l w-250" id="personPhone"
                                     placeholder="请输入电话"  autocomplete="off" disabled>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>联系地址：</span></label>
                            <input   type="text" class="input-text f-l w-250" id="personAdress"
                                     placeholder="请输入联系地址"  autocomplete="off" disabled>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>电子邮箱：</span></label>
                            <input    type="text" class="input-text f-l w-250" id="personMail"
                                     placeholder="请输入电子邮箱"  autocomplete="off" disabled>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>留言分类：</span></label>
                            <input  type="text" class="input-text f-l w-250" id="leaveType"
                                     placeholder="请输入留言分类"  autocomplete="off" disabled>
                        </div>
                    </td>

                </tr>
                <tr>
                <td>
                    <div class="row ml-10 clearfix ">
                        <label class="f-l lh-26 w-200 text-r"><span>用户留言：</span></label>
                        <div class="tdk_box">
                            <textarea  rows="3" id="leaveText"  cols="20" class="input-text f-l" style="width: 600px; height: 100px;" disabled></textarea>
                        </div>
                    </div>
                </td>
                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>留言时间：</span></label>
                            <span class="f-l lh-26" id="createTime"></span>
                        </div>
                    </td>

                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix">
                            <label class="f-l w-200 text-r"><span>处理状态：</span></label>
                            <span class="select-box size-M radius col-xs-8 w-180"  style="margin-top: -5px;">
                                <select class="select" size="1" id="leaveSatus">
                                     <option value="0" >待处理</option>
                                    <option value="1" >已处理</option>
                                </select>
                                </span>
                        </div>
                    </td>
                </tr>
                <tr>
                    <td>
                        <div class="row ml-10 clearfix ">
                            <label class="f-l lh-26 w-200 text-r"><span>我的备注：</span></label>
                            <div class="tdk_box">
                                <textarea  rows="3" id="leaveRemark"  cols="20" class="input-text f-l" style="width: 600px; height: 100px;" onkeyup="value=value.replace(/[\d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[\d]/g,''))" maxlength="100"></textarea>
                            </div>
                        </div>
                    </td>
                </tr>
                </tbody>
            </table>

            <div class="text-c mt-20">

                <input type="button" onclick="cancelBtn()" style="margin-left: 48px;" value="取消" class="btn btn-secondary size-S radius">
                <input type="button" onclick="preservation()"  style="margin-left: 47px;" value="保存" class="btn btn-secondary size-S radius">
            </div>
            <div class="text-c mt-20">

            </div>
        </div>

    </form>
</article>
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="../../../lib/jquery/1.9.1/jquery.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/layer/2.4/layer.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui/js/H-ui.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../static/h-ui.admin/js/H-ui.admin.js?rev=@@hash"></script> <!--/_footer 作为公共模版分离出去-->
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="../../../lib/My97DatePicker/4.8/WdatePicker.js?rev=@@hash"></script>
<!--表单验证-->
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/jquery.validate.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/validate-methods.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/jquery.validation/1.14.0/messages_zh.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/datatables/1.10.0/jquery.dataTables.min.js?rev=@@hash"></script>
<script type="text/javascript" src="../../../lib/laypage/1.2/laypage.js?rev=@@hash"></script>
<script src="../../../ht-js/public.js?rev=@@hash"></script>
<!--验证token-->
<script src="../../../ht-js/verifyToken.js?rev=@@hash"></script>
<script src="../../../ht-js/operation-js/special/special_link.js?rev=@@hash"></script><!--落地页配置-->

<script type="text/javascript">
    //取消
    function cancelBtn() {
        var cu = layer.confirm('<span>是否不保存直接退出？</span>', {title:'提示',btn: ['确认', '取消']}, function(index){
            parent.layer.closeAll();
            layer.close(cu);
        },function(){
            layer.close(cu);

        });

    }
    //限制字符
    var len
    var Preser
    var common=100//要限制输入的字数
    function checkMaxIut(me,type) {
        var text=$(me).val()
        strlen(text)
        if(len>common){
            $(me).val(Preser)
        }else {
            Preser=$(me).val()
        }
    }
    function strlen(str){
        len = 0;
        for (var i=0; i<str.length; i++) {
            var c = str.charCodeAt(i);
            //单字节加1
            if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) {
                len++;
            } else {
                len+=2;
            }
        }
        return len;
    }
    var customerMessageId=sessionStorage.getItem("customerMessageId")
    //查询
    customerDetails()
function customerDetails() {
    $.ajax({
        type: "POST",
        url: root.brandWebsite.getDetail,
        cache: false,  //禁用缓存
        dataType: "json",
        data: {
            "id":customerMessageId,
        },
        success: function (data) {
            console.log(data)
            var customerMessage=data.data
            $("#personName").val(customerMessage.personName)
            $("#personPhone").val(customerMessage.personPhone)
            $("#personAdress").val(customerMessage.personAdress)
            $("#personMail").val(customerMessage.personMail)
            var leaveType = ""
            if (customerMessage.leaveType == 1) {
                leaveType = '咨询'
            }else if (customerMessage.leaveType == 2) {
                leaveType = '加盟'
            }else if (customerMessage.leaveType == 3) {
                leaveType = '询价'
            }else {
                leaveType = '投诉'
            }
            $("#leaveType").val(leaveType)
            $("#leaveText").val(customerMessage.leaveText)
            $("#createTime").html(customerMessage.createTime)
            $("#leaveSatus").val(customerMessage.leaveSatus)
            $("#leaveRemark").val(customerMessage.leaveRemark)


        },
        error: function () {
            $.Huimodalalert('失败！',2000);
        }
    });
}
//保存
function preservation() {
        console.log($("#leaveSatus").val())
    $.ajax({
        type: "POST",
        url: root.brandWebsite.updateLeaveMsg,
        cache: false,  //禁用缓存
        dataType: "json",
        contentType: "application/json",
        data: JSON.stringify({
            "id":customerMessageId,
            "leaveSatus": $("#leaveSatus").val(),
            "processingUser":JSON.parse(decodeURIComponent(web.readCookie("loginData"))).user.name,
            "leaveRemark":$("#leaveRemark").val(),
        }),
        success: function (data) {
            if(data.errorCode==0){
                layer.msg("保存成功",{icon: 6,time:2000},function () {
                    setTimeout(function () {
                        window.parent.customerMessagequerys();
                        var index = parent.layer.getFrameIndex(window.name);
                        parent.layer.close(index);
                    })
                });
            }else {
                layer.msg(data.msg, {icon: 5,time:1000});
            }
        },
        error: function () {
            $.Huimodalalert('失败！',2000);
        }
    });
}




</script>
</body>
</html>